Guillem Jover [Fri, 16 Aug 2019 00:33:46 +0000 (02:33 +0200)]
[PATCH libaio] Fix io_pgetevents() syscall wrapper on 32-bit userland on 64-bit kernels
The kernel compat syscall in the kernel got introduced with a broken
layout, which requires a pointer to the actual sigset_t variable but
with the size of the running kernel, not the size of the compat code.
This means that when the wrapper sends the expected compat (32-bit)
pointer, the kernel reads a 64-bit pointer, eating with it also the
sigset size member. And then proceeds to fail the comparison of the
sigset_t size and returns EINVAL.
This really needs to be fixed in the kernel, as there's no apparent
user of the broken compat layout (from codesearch.debian.org, nor a
quick github.com search). But we have to workaround it in libaio so
that we can use kernels that have not yet been fixed.
We do that, by trying the non-broken layout (that would be used with
a 32-bit userland on a 32-bit kernel), and if that fails with -EINVAL
we retry with a structure padded to what the kernel expects.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0001-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch
Guillem Jover [Tue, 2 Nov 2021 21:37:32 +0000 (22:37 +0100)]
[PATCH 2/2] Use new symver function attribute to support LTO builds
The LTO support cannot work properly when there are versioned symbols
via asm statements, as those are not seen by the compiler. Use the new
function attributes if supported instead of the asm statements.
We need to move the SYMVER calls after the function definitions
otherwise it will reference symbols not yet seen.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0002-Use-new-symver-function-attribute-to-support-LTO-bui.patch
[PATCH libaio 11/11] build: Honour user build flags
CPPFLAGS, CFLAGS and LDFLAGS are user flags, which we need to preserve.
Any required flag that the build system needs, has to be set in some
other flag so that the build will succeed even if the user flags are
passed.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0011-build-Honour-user-build-flags.patch
The convention for DESTDIR is that it is only prefixed during the
install target. In this case we postpone that to the inner Makefile
so that it can be invoked directly while preserving the expected
semantics.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0009-build-Fix-DESTDIR-handling.patch
Lee Duncan [Sun, 14 Feb 2021 22:59:07 +0000 (14:59 -0800)]
[PATCH libaio] Fix test issue with gcc-11
Test 3.t exercises io_submit() with invalid addresses,
and one test attempted to pass in "-1" as an invalid
pointer. But gcc-11 realizes you cannot take an offset
from an invalid pointer, making it impossible to
compile or run this test:
> sh# make CC=gcc-11 partcheck
> make[1]: Entering directory '/alt/public_software/libaio/src'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory '/alt/public_software/libaio/src'
> make[1]: Entering directory '/alt/public_software/libaio/harness'
> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/2.t\" -o cases/2.p main.c ../src/libaio.a -lpthread
> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/3.t\" -o cases/3.p main.c ../src/libaio.a -lpthread
> In file included from main.c:24:
> cases/3.t: In function ‘test_main’:
> cases/3.t:18:19: error: ‘attempt_io_submit’ accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
> 18 | status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cases/3.t:18:19: note: referencing argument 3 of type ‘struct iocb **’
> In file included from cases/3.t:5,
> from main.c:24:
> cases/aio_setup.h:15:5: note: in a call to function ‘attempt_io_submit’
> 15 | int attempt_io_submit(io_context_t ctx, long nr, struct iocb *ios[], int expect)
> | ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[1]: *** [Makefile:19: cases/3.p] Error 1
> make[1]: Leaving directory '/alt/public_software/libaio/harness'
> make: *** [Makefile:23: partcheck] Error 2
The fix is to tell gcc to relax it's stringop overflow
testing for this one test.
Changes since v1:
* First version just skipped the test in question
Signed-off-by: Lee Duncan <leeman.duncan@gmail.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0001-Fix-test-issue-with-gcc-11.patch
Guillem Jover [Wed, 21 Aug 2019 03:29:52 +0000 (05:29 +0200)]
[PATCH libaio 28/28] harness: Skip the test if io_pgetevents() is not implemented
Either the kernel or the syscall wrapper will return -ENOSYS when this
syscall is not implemented. So we should cope with this in the test
suite and SKIP the test case.
This is currently the case for alpha and ia64, even though they have
already been wired up very recently in the kernel mainline.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch
Guillem Jover [Wed, 21 Aug 2019 03:29:50 +0000 (05:29 +0200)]
[PATCH libaio 27/28] harness: Print better error messages on error conditions in 22.t
These should help diagnose problems when dealing with error failures.
In particular this helped distinguish the problem with io_pgetevents()
not being implemented and it failing due to the sigset_t layout bug.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: fix up 80 columns violations] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0027-harness-Print-better-error-messages-on-error-conditi.patch
The actual problem in the original code was that read() was being used
to assert whether the buffer was readable, but the kernel was instead
reading from the file descriptor and then writing into the buffer, so
no EFAULT was being generated (on architectures that do so).
We needed to use a write() so that the kernel would read from the
buffer.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0026-harness-Fix-PROT_WRITE-mmap-check.patch
[PATCH libaio 23/28] harness: Handle -ENOTSUP from io_submit() with RWF_NOWAIT
On filesystems such as tmpfs the syscall might return -ENOTSUP instead
of EINVAL when it does not support the RWF_NOWAIT flag.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: skip the test instead of returning success]
[JEM: make the error message differentiate between kernel and fs support] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch
[PATCH libaio 22/28] harness: Add fallback code for filesystems not supporting O_DIRECT
When running the harness on a filesystem such as a tmpfs, which do not
support O_DIRECT, fallback to calls without the flag.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: change from duplicating the open call to using F_SETFL]
[JEM: 18 and 21 require O_DIRECT-skip if not present] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0022-harness-Add-fallback-code-for-filesystems-not-suppor.patch
Jeff Moyer [Mon, 29 Jul 2019 17:16:18 +0000 (13:16 -0400)]
[PATCH libaio 21/28] harness: add support for skipping tests
Skipped tests will not cause the test harness to return failure. An
exit status of "3" was chosen for skipped tests. This doesn't
conflict with any of the current tests.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0021-harness-add-support-for-skipping-tests.patch
[PATCH libaio 18/28] harness: Use run-time _SC_PAGE_SIZE instead of build-time PAGESIZE
The getconf(1) command is inherently not cross-compilation friendly.
In addition PAGESIZE depends on the specific system, even within a
specific arch, so using a hard-coded value is never safe.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0018-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch
[PATCH libaio 17/28] harness: Use destination strncpy() expression for sizeof() argument
Even though this is the same size, as the sizeof() is derived from the
source expression, recent gcc versions will emit a warning, which is
turned into an error by -Werror:
error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression
as the source; did you mean to use the size of the destination?
[-Werror=sizeof-pointer-memaccess]
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0017-harness-Use-destination-strncpy-expression-for-sizeo.patch
- Remove unnecessary macro argument quoting.
- Variables, pathnames in italics.
- Keywords in bold.
- Man page references in bold, followed by the man page number.
- Fix TP/TQ macro usage.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0013-man-Fix-markup.patch
[PATCH libaio] Link against libgcc to avoid unresolved symbols
We need to link agaisnt -lgcc, on at least hppa, PPC and ARC.
That's because in some corner-cases like compilation with -Os
on ARC and PPC so-called millicode (basically function prologue and
epilogue) implemented in libgcc.a is used. So we end up with
GLOBAL UNDEFINED symbol in libaio.so and then on linkage of the final
applicaiton LD fails to proceed saying:
--------------------------->8----------------------
hidden symbol '__ld_r13_to_r15_ret' in .../libgcc.a(_millicodethunk_ret.o) is referenced by DSO
--------------------------->8----------------------
Also it looks like in general it is not the best idea to use either
"-nostartfiles" or "-nostdlib" when linking shared libs because
default construtor/destructor functions won't be executed, see
"5.2. Library constructor and destructor functions" in [1]
So let's stop passing "-nostdlib" and "-nostartfiles" and get required
stuff built-in libaio.
Initial patch taken from Debian [2].
Fixes build failures in Buildroot like blktrace [3], lvm2 [4].
Guillem Jover [Tue, 2 Nov 2021 23:56:45 +0000 (23:56 +0000)]
libaio (0.3.112-12) unstable; urgency=medium
* Add patch from upstream to fix test suite warning with gcc-11.
* Fix LTO build by using symver function attribute instead of .symver
__asm__ statement. (Closes: #998309)
Guillem Jover [Fri, 16 Aug 2019 00:33:46 +0000 (02:33 +0200)]
[PATCH libaio] Fix io_pgetevents() syscall wrapper on 32-bit userland on 64-bit kernels
The kernel compat syscall in the kernel got introduced with a broken
layout, which requires a pointer to the actual sigset_t variable but
with the size of the running kernel, not the size of the compat code.
This means that when the wrapper sends the expected compat (32-bit)
pointer, the kernel reads a 64-bit pointer, eating with it also the
sigset size member. And then proceeds to fail the comparison of the
sigset_t size and returns EINVAL.
This really needs to be fixed in the kernel, as there's no apparent
user of the broken compat layout (from codesearch.debian.org, nor a
quick github.com search). But we have to workaround it in libaio so
that we can use kernels that have not yet been fixed.
We do that, by trying the non-broken layout (that would be used with
a 32-bit userland on a 32-bit kernel), and if that fails with -EINVAL
we retry with a structure padded to what the kernel expects.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0001-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch
[PATCH libaio 11/11] build: Honour user build flags
CPPFLAGS, CFLAGS and LDFLAGS are user flags, which we need to preserve.
Any required flag that the build system needs, has to be set in some
other flag so that the build will succeed even if the user flags are
passed.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0011-build-Honour-user-build-flags.patch
The convention for DESTDIR is that it is only prefixed during the
install target. In this case we postpone that to the inner Makefile
so that it can be invoked directly while preserving the expected
semantics.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0009-build-Fix-DESTDIR-handling.patch
Guillem Jover [Wed, 21 Aug 2019 03:29:52 +0000 (05:29 +0200)]
[PATCH libaio 28/28] harness: Skip the test if io_pgetevents() is not implemented
Either the kernel or the syscall wrapper will return -ENOSYS when this
syscall is not implemented. So we should cope with this in the test
suite and SKIP the test case.
This is currently the case for alpha and ia64, even though they have
already been wired up very recently in the kernel mainline.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch
Guillem Jover [Wed, 21 Aug 2019 03:29:50 +0000 (05:29 +0200)]
[PATCH libaio 27/28] harness: Print better error messages on error conditions in 22.t
These should help diagnose problems when dealing with error failures.
In particular this helped distinguish the problem with io_pgetevents()
not being implemented and it failing due to the sigset_t layout bug.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: fix up 80 columns violations] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0027-harness-Print-better-error-messages-on-error-conditi.patch
The actual problem in the original code was that read() was being used
to assert whether the buffer was readable, but the kernel was instead
reading from the file descriptor and then writing into the buffer, so
no EFAULT was being generated (on architectures that do so).
We needed to use a write() so that the kernel would read from the
buffer.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0026-harness-Fix-PROT_WRITE-mmap-check.patch
[PATCH libaio 23/28] harness: Handle -ENOTSUP from io_submit() with RWF_NOWAIT
On filesystems such as tmpfs the syscall might return -ENOTSUP instead
of EINVAL when it does not support the RWF_NOWAIT flag.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: skip the test instead of returning success]
[JEM: make the error message differentiate between kernel and fs support] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch
[PATCH libaio 22/28] harness: Add fallback code for filesystems not supporting O_DIRECT
When running the harness on a filesystem such as a tmpfs, which do not
support O_DIRECT, fallback to calls without the flag.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
[JEM: change from duplicating the open call to using F_SETFL]
[JEM: 18 and 21 require O_DIRECT-skip if not present] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0022-harness-Add-fallback-code-for-filesystems-not-suppor.patch
Jeff Moyer [Mon, 29 Jul 2019 17:16:18 +0000 (13:16 -0400)]
[PATCH libaio 21/28] harness: add support for skipping tests
Skipped tests will not cause the test harness to return failure. An
exit status of "3" was chosen for skipped tests. This doesn't
conflict with any of the current tests.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0021-harness-add-support-for-skipping-tests.patch
[PATCH libaio 18/28] harness: Use run-time _SC_PAGE_SIZE instead of build-time PAGESIZE
The getconf(1) command is inherently not cross-compilation friendly.
In addition PAGESIZE depends on the specific system, even within a
specific arch, so using a hard-coded value is never safe.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0018-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch
[PATCH libaio 17/28] harness: Use destination strncpy() expression for sizeof() argument
Even though this is the same size, as the sizeof() is derived from the
source expression, recent gcc versions will emit a warning, which is
turned into an error by -Werror:
error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression
as the source; did you mean to use the size of the destination?
[-Werror=sizeof-pointer-memaccess]
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0017-harness-Use-destination-strncpy-expression-for-sizeo.patch
- Remove unnecessary macro argument quoting.
- Variables, pathnames in italics.
- Keywords in bold.
- Man page references in bold, followed by the man page number.
- Fix TP/TQ macro usage.
Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0013-man-Fix-markup.patch
[PATCH libaio] Link against libgcc to avoid unresolved symbols
We need to link agaisnt -lgcc, on at least hppa, PPC and ARC.
That's because in some corner-cases like compilation with -Os
on ARC and PPC so-called millicode (basically function prologue and
epilogue) implemented in libgcc.a is used. So we end up with
GLOBAL UNDEFINED symbol in libaio.so and then on linkage of the final
applicaiton LD fails to proceed saying:
--------------------------->8----------------------
hidden symbol '__ld_r13_to_r15_ret' in .../libgcc.a(_millicodethunk_ret.o) is referenced by DSO
--------------------------->8----------------------
Also it looks like in general it is not the best idea to use either
"-nostartfiles" or "-nostdlib" when linking shared libs because
default construtor/destructor functions won't be executed, see
"5.2. Library constructor and destructor functions" in [1]
So let's stop passing "-nostdlib" and "-nostartfiles" and get required
stuff built-in libaio.
Initial patch taken from Debian [2].
Fixes build failures in Buildroot like blktrace [3], lvm2 [4].
Guillem Jover [Thu, 24 Dec 2020 14:41:17 +0000 (14:41 +0000)]
libaio (0.3.112-9) unstable; urgency=medium
* Remove Build-Depends on dpkg-dev, satisfied in stable.
* Switch to debhelper compatibility level 13.
* Do not pass ChangeLog to dh_installchangelogs, now handled by default.
* Switch to Standards-Version 4.5.1 (no changes needed).
* Switch to the dh sequencer.
* Add debian/upstream/metadata file.
Guillem Jover [Sun, 10 Dec 2017 19:22:11 +0000 (20:22 +0100)]
[PATCH 12/15] man: Fix markup
- Remove unnecessary macro argument quoting.
- Variables, pathnames in italics.
- Keywords in bold.
- Man page references in bold, followed by the man page number.
- Fix TP/TQ macro usage.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0012-man-Fix-markup.patch